/**
 * 
 */
package com.antonio081014.arielclock;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;

/**
 * @author antonio081014
 * 
 */
public class Alarms extends Activity {

	private Button btn_newAlarm;
	protected ArrayList<Alarm> alarmList;

	protected BaseAdapter myAdapter = new BaseAdapter() {

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public long getItemId(int position) {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public Object getItem(int position) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public int getCount() {
			// TODO Auto-generated method stub
			return 0;
		}
	};

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.alarm);
		btn_newAlarm = (Button) findViewById(R.id.btn_createAlarm);
		btn_newAlarm.setOnClickListener(myOnClickListener);
	}

	private void Default() {
		alarmList = new ArrayList<Alarm>();
	}

	private View.OnClickListener myOnClickListener = new View.OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			if (v == btn_newAlarm) {
				Intent intent = new Intent(Alarms.this, CreateAlarm.class);
				Alarms.this.startActivity(intent);
			}
		}
	};

	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu_alarm, menu);
		return true;
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.addAlarm:
			addTheAlarm();
			return true;
		default:
			return super.onOptionsItemSelected(item);
		}
	}

	private void addTheAlarm() {
		Intent intent = new Intent(Alarms.this, CreateAlarm.class);
		Alarms.this.startActivity(intent);
	}
}
